<template>
  <div class="home">
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link>
    <img alt="Vue logo" src="../assets/logo.png" />
    <HelloWorld msg="Welcome to Your Vue.js App" />
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";

export default {
  name: "Home",
  components: {
    HelloWorld
  },
  mounted() {
    // this.initPage();
  },
  methods: {
    initPage() {
      // this.getUserInfo();
    },
    getUserInfo() {
      this.$api.userApi
        .checkAuthAjax()
        .then(res => {
          console.log(res.data);
        })
        .catch(error => {
          console.log(error);
        });
    },
    test() {
      // console.log("start");
      setTimeout(() => {
        // console.log("children2");
        Promise.resolve().then(() => {
          // console.log("children2-1");
        });
      }, 0);
      setTimeout(() => {
        console.log("children3");
        Promise.resolve().then(() => {
          console.log("children3-1");
        });
      }, 0);
      Promise.resolve().then(() => {
        console.log("children1");
      });
      console.log("end");
    }
  }
};
</script>
